package cn.wolfcode.wolf2w.service.impl;

import cn.wolfcode.wolf2w.domain.Spot;
import cn.wolfcode.wolf2w.repository.SpotRepository;
import cn.wolfcode.wolf2w.service.ISpotService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SpotServiceImpl implements ISpotService {

    @Autowired
    private SpotRepository repository;

    @Override
    public List<Spot> list() {

        List<Spot> list = repository.findAll();
        return list;
    }

    @Override
    public Spot get(String id) {
        Spot spot = repository.findById(id).orElse(null);
        return spot;
    }
}
